home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Leser 15 / Amiga Plus Leser CD 15.iso / Tools / Freeware / reportplus / source / f11.c < prev    next >
Encoding:
C/C++ Source or Header  |  2002-03-13  |  19.7 KB  |  569 lines

  1. #include <exec/types.h>
  2. #include <proto/exec.h>
  3. #include <intuition/intuition.h>
  4. #include <intuition/gadgetclass.h>
  5. #include <proto/intuition.h>
  6. #include <libraries/gadtools.h>
  7. #include <proto/gadtools.h>
  8.  
  9. #define ALL_REACTION_CLASSES
  10. #define ALL_REACTION_MACROS
  11. #include <reaction/reaction.h>
  12. #include <gadgets/texteditor.h>
  13. #include <clib/texteditor_protos.h>
  14. #include <pragmas/texteditor_pragmas.h>
  15.  
  16. #include <ctype.h>
  17. #include <stdlib.h>
  18. #include <string.h>
  19. #include "rp.h"
  20.  
  21. IMPORT  struct AminetStruct aminet;
  22. AGLOBAL struct AGDBStruct   agdb;
  23.  
  24. AGLOBAL struct Gadget*      agdb_gadgets[GIDS_11 + 1];
  25.  
  26. // from rp.c
  27. IMPORT Object*              WinObject[FUNCTIONS + 1];
  28. IMPORT SBYTE                page;
  29. IMPORT struct Window*       MainWindowPtr;
  30. IMPORT struct SharedStruct  shared;
  31. IMPORT struct Screen*       ScreenPtr;
  32. IMPORT struct Menu*         MenuPtr;
  33. IMPORT ULONG                offset,
  34.                             signal;
  35. IMPORT TEXT                 IOBuffer[LONGESTFIELD + 1],
  36.                             aslresult[MEDFIELD + 1],
  37.                             string[VLONGFIELD + 1];
  38. IMPORT struct Library*      TextEditorBase;
  39.  
  40. MODULE void updateagdbgadgets(void);
  41. MODULE void readagdbgadgets(void);
  42.  
  43. AGLOBAL void agdb1(void)
  44. {   struct Hook Hook11Struct;
  45.  
  46.     if ((!(aminet.uploader[0])) && readin("S:Report.sender"))
  47.     {   /* # Refer: <last>,<first> (<company> ,phone <phone>)<LF>
  48.            # Path: <email><LF>
  49.            # ReferID: <developer><LF> */
  50.  
  51.         offset = 0;
  52.         parse("# Refer: ");
  53.         parse(",");
  54.         parse(" (");
  55.         parse(" ,phone ");
  56.         parse(")\n# Path: ");
  57.         parse("\n# ReferID: ");
  58.         strcpy(aminet.uploader, string);
  59.     }
  60.  
  61.     /* Create the window object. */
  62.     lockscreen();
  63.     gadtools();
  64.     InitHook(&Hook11Struct, Hook11Func, NULL);
  65.  
  66. if (!(WinObject[11] =
  67. NewObject
  68. (
  69.     WINDOW_GetClass(),                    NULL,
  70.     WA_PubScreen,                         ScreenPtr,
  71.     WA_ScreenTitle,                       "Report+",
  72.     WA_Title,                             "Report+: AGDB Review Editor",
  73.     WA_Activate,                          TRUE,
  74.     WA_DepthGadget,                       TRUE,
  75.     WA_DragBar,                           TRUE,
  76.     WA_CloseGadget,                       TRUE,
  77.     WA_SizeGadget,                        TRUE,
  78.     WA_IDCMP,                             IDCMP_RAWKEY,
  79.     WINDOW_IDCMPHook,                     &Hook11Struct,
  80.     WINDOW_IDCMPHookBits,                 IDCMP_RAWKEY,
  81.     WINDOW_MenuStrip,                     MenuPtr,
  82.     WINDOW_Position,                      WPOS_FULLSCREEN,
  83.     WINDOW_ParentGroup,                   agdb_gadgets[GID_11_LY1] =
  84.     NewObject
  85.     (   LAYOUT_GetClass(),                NULL,
  86.         LAYOUT_Orientation,               LAYOUT_ORIENT_VERT,
  87.         LAYOUT_SpaceOuter,                TRUE,
  88.         LAYOUT_DeferLayout,               TRUE,
  89.         LAYOUT_AddChild,                  NewObject(LAYOUT_GetClass(), NULL,
  90.         LAYOUT_Orientation,               LAYOUT_ORIENT_HORIZ,
  91.         LAYOUT_SpaceOuter,                TRUE,
  92.         LAYOUT_DeferLayout,               TRUE,
  93.         LAYOUT_AddChild,                  NewObject(LAYOUT_GetClass(), NULL,
  94.             LAYOUT_Orientation,           LAYOUT_ORIENT_VERT,
  95.             LAYOUT_SpaceOuter,            TRUE,
  96.             LAYOUT_VertAlignment,         LALIGN_CENTER,
  97.             LAYOUT_BevelStyle,            BVS_NONE,
  98.             LAYOUT_AddChild,              NewObject(LAYOUT_GetClass(), NULL,
  99.                 LAYOUT_Orientation,       LAYOUT_ORIENT_HORIZ,
  100.                 LAYOUT_SpaceOuter,        TRUE,
  101.                 LAYOUT_HorizAlignment,    LALIGN_RIGHT,
  102.                 // LALIGN_RIGHT seems not to work, as you can see :-(
  103.                 LAYOUT_BevelStyle,        BVS_FIELD,
  104.                 LAYOUT_AddImage,          NewObject
  105.                 (   LABEL_GetClass(),     NULL,
  106.                     // label
  107.                     LABEL_Text,           "_Title:",
  108.                     LABEL_Justification,  LJ_RIGHT,
  109.                     TAG_END
  110.                 ),
  111.                 TAG_END
  112.             ),
  113.             LAYOUT_AddChild,              NewObject(LAYOUT_GetClass(), NULL,
  114.                 // layout
  115.                 LAYOUT_Orientation,       LAYOUT_ORIENT_HORIZ,
  116.                 LAYOUT_SpaceOuter,        TRUE,
  117.                 LAYOUT_HorizAlignment,    LALIGN_RIGHT,
  118.                 LAYOUT_BevelStyle,        BVS_FIELD,
  119.                 LAYOUT_AddImage,          NewObject
  120.                 (   LABEL_GetClass(),     NULL,
  121.                     // label
  122.                     LABEL_Text,           "_Publisher (Year):",
  123.                     LABEL_Justification,  LJ_RIGHT,
  124.                     TAG_END
  125.                 ),
  126.                 TAG_END
  127.             ),
  128.             LAYOUT_AddChild,
  129.             NewObject
  130.             (   LAYOUT_GetClass(),        NULL,
  131.                 LAYOUT_Orientation,       LAYOUT_ORIENT_HORIZ,
  132.                 LAYOUT_SpaceOuter,        TRUE,
  133.                 LAYOUT_HorizAlignment,    LALIGN_RIGHT,
  134.                 LAYOUT_BevelStyle,        BVS_FIELD,
  135.                 LAYOUT_AddImage,          NewObject
  136.                 (   LABEL_GetClass(),     NULL,
  137.                     // label
  138.                     LABEL_Text,           "_Game Type:",
  139.                     LABEL_Justification,  LJ_RIGHT,
  140.                     TAG_END
  141.                 ),
  142.                 TAG_END
  143.             ),
  144.             LAYOUT_AddChild,              NewObject(LAYOUT_GetClass(), NULL,
  145.                 // layout
  146.                 LAYOUT_Orientation,       LAYOUT_ORIENT_HORIZ,
  147.                 LAYOUT_SpaceOuter,        TRUE,
  148.                 LAYOUT_HorizAlignment,    LALIGN_RIGHT,
  149.                 LAYOUT_BevelStyle,        BVS_FIELD,
  150.                 LAYOUT_AddImage,          NewObject
  151.                 (   LABEL_GetClass(),     NULL,
  152.                     // label
  153.                     LABEL_Text,           "P_layers:",
  154.                     LABEL_Justification,  LJ_RIGHT,
  155.                     TAG_END
  156.                 ),
  157.                 TAG_END
  158.             ),
  159.             LAYOUT_AddChild,
  160.             NewObject
  161.             (   LAYOUT_GetClass(),        NULL,
  162.                 LAYOUT_Orientation,       LAYOUT_ORIENT_HORIZ,
  163.                 LAYOUT_SpaceOuter,        TRUE,
  164.                 LAYOUT_HorizAlignment,    LALIGN_RIGHT,
  165.                 LAYOUT_BevelStyle,        BVS_FIELD,
  166.                 LAYOUT_AddImage,          NewObject
  167.                 (   LABEL_GetClass(),     NULL,
  168.                     // label
  169.                     LABEL_Text,           "_Compatibility:",
  170.                     LABEL_Justification,  LJ_RIGHT,
  171.                     TAG_END
  172.                 ),
  173.                 TAG_END
  174.             ),
  175.             LAYOUT_AddChild,
  176.             NewObject
  177.             (   LAYOUT_GetClass(),        NULL,
  178.                 LAYOUT_Orientation,       LAYOUT_ORIENT_HORIZ,
  179.                 LAYOUT_SpaceOuter,        TRUE,
  180.                 LAYOUT_HorizAlignment,    LALIGN_RIGHT,
  181.                 LAYOUT_BevelStyle,        BVS_FIELD,
  182.                 LAYOUT_AddImage,          NewObject
  183.                 (   LABEL_GetClass(),     NULL,
  184.                     // label
  185.                     LABEL_Text,           "_HD Installable?",
  186.                     LABEL_Justification,  LJ_RIGHT,
  187.                     TAG_END
  188.                 ),
  189.                 TAG_END
  190.             ),
  191.             LAYOUT_AddChild,              NewObject(LAYOUT_GetClass(), NULL,
  192.                 // layout
  193.                 LAYOUT_Orientation,       LAYOUT_ORIENT_HORIZ,
  194.                 LAYOUT_SpaceOuter,        TRUE,
  195.                 LAYOUT_HorizAlignment,    LALIGN_RIGHT,
  196.                 LAYOUT_BevelStyle,        BVS_FIELD,
  197.                 LAYOUT_AddImage,          NewObject
  198.                 (   LABEL_GetClass(),     NULL,
  199.                     // label
  200.                     LABEL_Text,           "_Submission:",
  201.                     LABEL_Justification,  LJ_RIGHT,
  202.                     TAG_END
  203.                 ),
  204.                 CHILD_WeightedWidth,      0,
  205.                 TAG_END
  206.             ),
  207.             TAG_END
  208.         ),
  209.         CHILD_WeightedHeight,             0,
  210.         CHILD_WeightedWidth,              0,
  211.         LAYOUT_AddChild,
  212.         NewObject
  213.         (   LAYOUT_GetClass(),            NULL,
  214.             LAYOUT_Orientation,   LAYOUT_ORIENT_VERT,
  215.             LAYOUT_SpaceOuter,    TRUE,
  216.             LAYOUT_VertAlignment, LALIGN_CENTER,
  217.             LAYOUT_HorizAlignment,LALIGN_CENTER,
  218.             LAYOUT_BevelStyle,    BVS_FIELD,
  219.             LAYOUT_AddChild,      agdb_gadgets[GID_11_ST1] =
  220.                                   NewObject(STRING_GetClass(), NULL,
  221.             // string        
  222.                 GA_ID,                GID_11_ST1,
  223.                 STRINGA_TextVal,      agdb.title,
  224.                 STRINGA_MinVisible,   20,
  225.             TAG_END),
  226.             LAYOUT_AddChild,      agdb_gadgets[GID_11_ST2] =
  227.                                   NewObject(STRING_GetClass(), NULL,
  228.                 // string        
  229.                 GA_ID,                GID_11_ST2,
  230.                 STRINGA_TextVal,      agdb.publisher,
  231.                 STRINGA_MinVisible,   20,
  232.             TAG_END),
  233.             LAYOUT_AddChild,      agdb_gadgets[GID_11_ST3] =
  234.                                   NewObject(STRING_GetClass(), NULL,
  235.                 // string        
  236.                 GA_ID,                GID_11_ST3,
  237.                 STRINGA_TextVal,      agdb.gametype,
  238.                 STRINGA_MinVisible,   20,
  239.             TAG_END),
  240.             LAYOUT_AddChild,      agdb_gadgets[GID_11_ST4] =
  241.                                   NewObject(STRING_GetClass(), NULL,
  242.                 // string        
  243.                 GA_ID,                GID_11_ST4,
  244.                 STRINGA_TextVal,      agdb.players,
  245.                 STRINGA_MinVisible,   20,
  246.             TAG_END),
  247.             LAYOUT_AddChild,      agdb_gadgets[GID_11_ST5] =
  248.                                   NewObject(STRING_GetClass(), NULL,
  249.                 // string        
  250.                 GA_ID,                GID_11_ST5,
  251.                 STRINGA_TextVal,      agdb.hdinstallable,
  252.                 STRINGA_MinVisible,   20,
  253.             TAG_END),
  254.             LAYOUT_AddChild,      agdb_gadgets[GID_11_ST6] =
  255.                                   NewObject(STRING_GetClass(), NULL,
  256.                 // string        
  257.                 GA_ID,                GID_11_ST6,
  258.                 STRINGA_TextVal,      agdb.compatibility,
  259.                 STRINGA_MinVisible,   20,
  260.             TAG_END),
  261.             LAYOUT_AddChild,      agdb_gadgets[GID_11_ST7] =
  262.                                   NewObject(STRING_GetClass(), NULL,
  263.                 // string        
  264.                 GA_ID,                GID_11_ST7,
  265.                 STRINGA_TextVal,      aminet.uploader,
  266.                 STRINGA_MinVisible,   20,
  267.             TAG_END),
  268.             CHILD_WeightedHeight,     0,
  269.             TAG_END
  270.         ),
  271.         CHILD_WeightedHeight,     0,
  272.         TAG_END
  273.     ),
  274.     CHILD_WeightedHeight,         0,
  275.         LAYOUT_AddChild,          NewObject(LAYOUT_GetClass(), NULL,
  276.             // layout
  277.             LAYOUT_Orientation,   LAYOUT_ORIENT_HORIZ,
  278.             LAYOUT_SpaceOuter,    TRUE,
  279.             LAYOUT_HorizAlignment,LALIGN_CENTER,
  280.             LAYOUT_BevelStyle,    BVS_FIELD,
  281.             LAYOUT_AddImage,          NewObject
  282.             (   LABEL_GetClass(),     NULL,
  283.                 // label
  284.                 LABEL_Text,           "_Review:",
  285.                 LABEL_Justification,  LJ_CENTER,
  286.                 TAG_END
  287.             ),
  288.             TAG_END
  289.         ),
  290.         CHILD_WeightedHeight,     0,
  291.         LAYOUT_AddChild,          agdb_gadgets[GID_11_TE1] =
  292.                                   (struct Gadget *) NewObject
  293.         (   TEXTEDITOR_GetClass(),    NULL,
  294.             GA_ID,                    GID_11_TE1,
  295.             GA_RelVerify,             TRUE,
  296.             GA_TEXTEDITOR_ExportWrap,  75,
  297.             TAG_END
  298.         ),
  299.         LAYOUT_AddChild,          agdb_gadgets[GID_11_BU1] =
  300.         NewObject
  301.         (   NULL, "button.gadget",
  302.             // button
  303.             GA_ID,                GID_11_BU1,
  304.             GA_RelVerify,         TRUE,
  305.             GA_Text,              "Menu",
  306.             TAG_END
  307.         ),
  308.         CHILD_WeightedHeight,     0,
  309.         TAG_END
  310.     ),
  311.     TAG_END
  312. )))
  313. {   rq("Can't create ReAction gadgets!");
  314. }
  315. unlockscreen();
  316. openwindow();
  317.  
  318.     SetGadgetAttrs
  319.     (   agdb_gadgets[GID_11_TE1],    MainWindowPtr, NULL,
  320.         GA_TEXTEDITOR_Contents, agdb.textfield
  321.     ); // long description
  322.     OnMenu(MainWindowPtr, FULLMENUNUM(MN_PROJECT, IN_NEW,    NOSUB));
  323.     OnMenu(MainWindowPtr, FULLMENUNUM(MN_PROJECT, IN_OPEN,   NOSUB));
  324.     OnMenu(MainWindowPtr, FULLMENUNUM(MN_PROJECT, IN_SAVE,   NOSUB));
  325.     OnMenu(MainWindowPtr, FULLMENUNUM(MN_PROJECT, IN_SAVEAS, NOSUB));
  326.  
  327.     ActivateLayoutGadget(agdb_gadgets[GID_11_LY1], MainWindowPtr, NULL, (Object) agdb_gadgets[GID_11_ST1]);
  328.     loop();
  329.     readagdbgadgets();
  330.     closewindow();
  331. }
  332.  
  333. AGLOBAL void saveagdb(ABOOL saveas)
  334. {   /*  Title            <title>
  335.         Publisher        <publisher>
  336.         Game Type        <game type>
  337.         Players          <players>
  338.         HD Installable   <hd installable>
  339.         Compatibility    <compatibility>
  340.         Submission       <uploader>
  341.         
  342.         Review
  343.         <review> */
  344.  
  345.     readagdbgadgets();
  346.  
  347.     strcpy(IOBuffer, "Title:           ");
  348.     strcat(IOBuffer, agdb.title);
  349.     strcat(IOBuffer, "\nPublisher:       ");
  350.     strcat(IOBuffer, agdb.publisher);
  351.     strcat(IOBuffer, "\nGame Type:       ");
  352.     strcat(IOBuffer, agdb.gametype);
  353.     strcat(IOBuffer, "\nPlayers:         ");
  354.     strcat(IOBuffer, agdb.players);
  355.     strcat(IOBuffer, "\nHD Installable:  ");
  356.     strcat(IOBuffer, agdb.hdinstallable);
  357.     strcat(IOBuffer, "\nCompatibility:   ");
  358.     strcat(IOBuffer, agdb.compatibility);
  359.     strcat(IOBuffer, "\nSubmission:      ");
  360.     strcat(IOBuffer, aminet.uploader);
  361.     strcat(IOBuffer, "\n\nReview:\n");
  362.     strcat(IOBuffer, agdb.textfield);
  363.  
  364.     if (!agdb.output[0] || saveas) // if we need a filename
  365.     {   if (saveasl("Save AGDB Review", "~(#?.info)"))
  366.         {   strcpy(agdb.output, aslresult);
  367.             writeout(agdb.output);
  368.     }   }
  369.     else
  370.     {   writeout(agdb.output);
  371. }   }
  372.  
  373. AGLOBAL void agdb_loop(ULONG gid)
  374. {   switch (gid)
  375.     {
  376.     case GID_11_BU1:
  377.         page = 0;
  378.     break;
  379.     default:
  380.     break;
  381. }   }
  382.  
  383. AGLOBAL ULONG Hook11Func(struct Hook *h, VOID *o, VOID *msg)
  384. {   /* "When the hook is called, the data argument points to the 
  385.     window object and message argument to the IntuiMessage." */
  386.  
  387.     UWORD code, qual;
  388.  
  389.     geta4(); // wait till here before doing anything
  390.  
  391.     code = ((struct IntuiMessage *) msg)->Code;
  392.     qual = ((struct IntuiMessage *) msg)->Qualifier;
  393.  
  394.     switch(code)
  395.     {
  396.     case SCAN_HELP:
  397.         helpabout();
  398.     break;
  399.     case SCAN_ESCAPE:
  400.         if ((qual & IEQUALIFIER_LSHIFT) || (qual & IEQUALIFIER_RSHIFT))
  401.         {   cleanexit(EXIT_SUCCESS);
  402.         } else page = 0;
  403.     break;
  404.     case SCAN_T:
  405.         ActivateLayoutGadget(agdb_gadgets[GID_11_LY1], MainWindowPtr, NULL, (Object) agdb_gadgets[GID_11_ST1]);
  406.     break;
  407.     case SCAN_P:
  408.         ActivateLayoutGadget(agdb_gadgets[GID_11_LY1], MainWindowPtr, NULL, (Object) agdb_gadgets[GID_11_ST2]);
  409.     break;
  410.     case SCAN_G:
  411.         ActivateLayoutGadget(agdb_gadgets[GID_11_LY1], MainWindowPtr, NULL, (Object) agdb_gadgets[GID_11_ST3]);
  412.     break;
  413.     case SCAN_L:
  414.         ActivateLayoutGadget(agdb_gadgets[GID_11_LY1], MainWindowPtr, NULL, (Object) agdb_gadgets[GID_11_ST4]);
  415.     break;
  416.     case SCAN_C:
  417.         ActivateLayoutGadget(agdb_gadgets[GID_11_LY1], MainWindowPtr, NULL, (Object) agdb_gadgets[GID_11_ST5]);
  418.     break;
  419.     case SCAN_H:
  420.         ActivateLayoutGadget(agdb_gadgets[GID_11_LY1], MainWindowPtr, NULL, (Object) agdb_gadgets[GID_11_ST6]);
  421.     break;
  422.     case SCAN_S:
  423.         ActivateLayoutGadget(agdb_gadgets[GID_11_LY1], MainWindowPtr, NULL, (Object) agdb_gadgets[GID_11_ST7]);
  424.     break;
  425.     case SCAN_R:
  426.         ActivateLayoutGadget(agdb_gadgets[GID_11_LY1], MainWindowPtr, NULL, (Object) agdb_gadgets[GID_11_TE1]);
  427.     break;
  428.     default:
  429.     break;
  430.     }
  431.  
  432.     return(1);
  433. }
  434.  
  435. AGLOBAL void newagdb(ABOOL display)
  436. {   strcpy(agdb.title,         "");
  437.     strcpy(agdb.publisher,     "");
  438.     strcpy(agdb.gametype,      "");
  439.     strcpy(agdb.players,       "");
  440.     strcpy(agdb.hdinstallable, "");
  441.     strcpy(agdb.compatibility, "");
  442.     strcpy(aminet.uploader,    "");
  443.     strcpy(agdb.output,        "");
  444.     strcpy(agdb.textfield,     "");
  445.  
  446.     if (display)
  447.         updateagdbgadgets();
  448. }
  449.  
  450. AGLOBAL void openagdb(void)
  451. {   if (asl("~(#?.info)"))
  452.     {   strcpy(agdb.output, aslresult);
  453.         loadagdb();
  454.         updateagdbgadgets();
  455. }   }
  456.  
  457. AGLOBAL void loadagdb(void)
  458. {   if (readin(agdb.output))
  459.     {   offset = 0;
  460.  
  461.         parse("Title:           ");
  462.         parse("\nPublisher:       ");
  463.         strcpy(agdb.title,         string);
  464.         parse("\nGame Type:       ");
  465.         strcpy(agdb.publisher,     string);
  466.         parse("\nPlayers:         ");
  467.         strcpy(agdb.gametype,      string);
  468.         parse("\nHD Installable:  ");
  469.         strcpy(agdb.players,       string);
  470.         parse("\nCompatibility:   ");
  471.         strcpy(agdb.hdinstallable, string);
  472.         parse("\nSubmission:      ");
  473.         strcpy(agdb.compatibility, string);
  474.         parse("\n\nReview:\n");
  475.         strcpy(aminet.uploader,    string);
  476.         parsetoend();
  477.         strcpy(agdb.textfield,     string);
  478.  
  479.         updateagdbgadgets();
  480. }   }
  481.  
  482. MODULE void updateagdbgadgets(void)
  483. {   SetGadgetAttrs
  484.     (   agdb_gadgets[GID_11_ST1], MainWindowPtr, NULL,
  485.         STRINGA_TextVal, agdb.title,
  486.         TAG_DONE
  487.     );
  488.     SetGadgetAttrs
  489.     (   agdb_gadgets[GID_11_ST2], MainWindowPtr, NULL,
  490.         STRINGA_TextVal, agdb.publisher,
  491.         TAG_DONE
  492.     );
  493.     SetGadgetAttrs
  494.     (   agdb_gadgets[GID_11_ST3], MainWindowPtr, NULL,
  495.         STRINGA_TextVal, agdb.gametype,
  496.         TAG_DONE
  497.     );
  498.     SetGadgetAttrs
  499.     (   agdb_gadgets[GID_11_ST4], MainWindowPtr, NULL,
  500.         STRINGA_TextVal, agdb.players,
  501.         TAG_DONE
  502.     );
  503.     SetGadgetAttrs
  504.     (   agdb_gadgets[GID_11_ST5], MainWindowPtr, NULL,
  505.         STRINGA_TextVal, agdb.hdinstallable,
  506.         TAG_DONE
  507.     );
  508.     SetGadgetAttrs
  509.     (   agdb_gadgets[GID_11_ST6], MainWindowPtr, NULL,
  510.         STRINGA_TextVal, agdb.compatibility,
  511.         TAG_DONE
  512.     );
  513.     SetGadgetAttrs
  514.     (   agdb_gadgets[GID_11_ST7], MainWindowPtr, NULL,
  515.         STRINGA_TextVal, aminet.uploader,
  516.         TAG_DONE
  517.     );
  518.     SetGadgetAttrs
  519.     (   agdb_gadgets[GID_11_TE1], MainWindowPtr, NULL,
  520.         GA_TEXTEDITOR_Contents, aminet.textfield,
  521.         TAG_DONE
  522.     );
  523. }
  524.  
  525. MODULE void readagdbgadgets(void)
  526. {   STRPTR textBuffer;
  527.  
  528.     if (!(GetAttr
  529.     (   STRINGA_TextVal, agdb_gadgets[GID_11_ST1], (ULONG *) agdb.title
  530.     )))
  531.     {   rq("Unsupported inquiry!"); // should never happen
  532.     }
  533.     if (!(GetAttr
  534.     (   STRINGA_TextVal, agdb_gadgets[GID_11_ST2], (ULONG *) agdb.publisher
  535.     )))
  536.     {   rq("Unsupported inquiry!"); // should never happen
  537.     }
  538.     if (!(GetAttr
  539.     (   STRINGA_TextVal, agdb_gadgets[GID_11_ST3], (ULONG *) agdb.gametype
  540.     )))
  541.     {   rq("Unsupported inquiry!"); // should never happen
  542.     }
  543.     if (!(GetAttr
  544.     (   STRINGA_TextVal, agdb_gadgets[GID_11_ST4], (ULONG *) agdb.players
  545.     )))
  546.     {   rq("Unsupported inquiry!"); // should never happen
  547.     }
  548.     if (!(GetAttr
  549.     (   STRINGA_TextVal, agdb_gadgets[GID_11_ST5], (ULONG *) agdb.hdinstallable
  550.     )))
  551.     {   rq("Unsupported inquiry!"); // should never happen
  552.     }
  553.     if (!(GetAttr                              
  554.     (   STRINGA_TextVal, agdb_gadgets[GID_11_ST6], (ULONG *) agdb.compatibility
  555.     )))
  556.     {   rq("Unsupported inquiry!"); // should never happen
  557.     }
  558.     if (!(GetAttr
  559.     (   STRINGA_TextVal, agdb_gadgets[GID_11_ST7], (ULONG *) aminet.uploader
  560.     )))
  561.     {   rq("Unsupported inquiry!"); // should never happen
  562.     }
  563.  
  564.     textBuffer = (STRPTR) DoGadgetMethod(agdb_gadgets[GID_11_TE1], MainWindowPtr, NULL, GM_TEXTEDITOR_ExportText, NULL);
  565.     strcpy(agdb.textfield, textBuffer); // long description
  566.     FreeVec((APTR) textBuffer);
  567.     // textBuffer = NULL;
  568. }
  569.